package models

import "gorm.io/gorm"

// 审核表
type Checks struct {
	gorm.Model
	UserId  int `gorm:"type:int;comment:'用户id'"`
	VideoId int `gorm:"type:int;comment:'视频id'"`
	Status  int `json:"status" gorm:"type:int;default:0;comment:'审核状态: 0-待审核 1-审核通过 2-审核未通过'"`
}

func (c *Checks) TableName() string {
	return "checks"
}

// 获取视频详情
func (c *Checks) GetVideoCheck(db *gorm.DB, videoId int64) error {
	return db.Model(&Checks{}).Where("video_id = ?", videoId).Limit(1).Find(&c).Error
}
